package idea.mybatis.db.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.criterion.MybatisCriterion;
import com.baomidou.mybatisplus.criterion.QueryCriterion;
import com.baomidou.mybatisplus.criterion.QueryOrder;
import com.baomidou.mybatisplus.plugins.Page;
import idea.mybatis.db.entity.VmMainSub;
import idea.mybatis.db.mapper.VmMainSubMapper;
import idea.mybatis.db.service.IVmMainSubService;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author idea
 * @since 2017-01-01
 */
@Service
public class VmMainSubServiceImpl implements IVmMainSubService {

    @Autowired
    private VmMainSubMapper mapper;

    @Override
    public List<VmMainSub> selectCriterion(QueryCriterion queryCriterion, QueryOrder queryOrder) {
        MybatisCriterion mybatisCriterion = new MybatisCriterion(queryCriterion, queryOrder);
        return mapper.selectCriterion(mybatisCriterion);
    }

    @Override
    public Page<VmMainSub> selectCriterionPage(Page<VmMainSub> page, QueryCriterion queryCriterion, QueryOrder queryOrder) {
        MybatisCriterion mybatisCriterion = new MybatisCriterion(queryCriterion, queryOrder);
        page.setRecords(mapper.selectCriterion(page, mybatisCriterion));
        return page;
    }

}
